import evaluate
# #导入一个指标
# acc = evaluate.load(r"D:\Code\sshcode\HuggingFace\evaluate-main\metrics\accuracy")
# res = acc.compute(predictions=[1,2,3],references=[1,2,4])
# print(res)

# clf_metrics = evaluate.combine([r"D:\Code\sshcode\HuggingFace\evaluate-main\metrics\accuracy",
#                                 r"D:\Code\sshcode\HuggingFace\evaluate-main\metrics\f1"])
# res = clf_metrics.compute(predictions=[1,2,2],references=[1,2,1])
# print(res)

from evaluate.visualization import radar_plot  # 目前只支持雷达图

data = [
    {"accuracy": 0.99, 'precision':0.8, "fl":0.97, 'latency_in_seconds': 33.6},
    {"accuracy": 0.98, 'precision':0.87, "fl":0.91, 'latency_in_seconds': 11.6},
    {"accuracy": 0.95, 'precision':0.68, "fl":0.92, 'latency_in_seconds': 23.6},
    {"accuracy": 0.99, 'precision':0.84, "fl":0.95, 'latency_in_seconds': 66.6}
]
model_name = ['Model 1', 'Model 2', 'Model 3', 'Model 4']
plot = radar_plot(data=data, model_names=model_name)
plot.show()